﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Web.Profile;

public partial class UserControls_LoginTest : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
      var member = Membership.GetUser();
      var profile = ProfileBase.Create(member.UserName);
      Label1.Text = "Du er logget ind som " + profile["memberFirstName"].ToString() + " " + profile["memberLastName"].ToString() + " og din e-mail er " + member.UserName;

      Companies c = new Companies();
      GridView1.DataSource = c.GetCompanies();
      GridView1.AutoGenerateColumns = false;
      GridView1.DataBind();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
      FormsAuthentication.SignOut();
      Response.Redirect("/");
    }
}